<?php
namespace logic\sys\message;
use think\Db;
class MessageLog{
    
    /**
     * 读取发送信息的日志列表
     */
    public function getList($param){
        $page   = $param['page'] ? $param['page'] : 1;
        $limit  = $param['limit'] ? $param['limit'] : 20;
        if( $param['type'] )    $where['type']      = $param['type'];   // 1 聚合接口 2 雷雨科技
        if( $param['status'])   $where['status']    = $param['status']; // success/fail
        $db =  \logic\sys\mongo\MongoDb::instance('message'); 
        $list = $db->where($where)->limit($limit)->page($page)->order('addtime')->select();
        $count = $db->where($where)->count();
        $result =  array(
            'count' => $count,
            'list'  => $list
        );
        return $result;
    }
    
    /**
     * 添加一条日志
     */
    public function addLog(){
        
    }
    
    
}